home *** CD-ROM | disk | FTP | other *** search
/ PC Basics 53 / PC Basics Issue 53.iso / Software / Internet / Invboard.exe / PC Basics 53 / Invboard / upload / sources / Register.php < prev    next >
Encoding:
PHP Script  |  2002-06-12  |  22.1 KB  |  711 lines

  1. <?php
  2.  
  3. /*
  4. +--------------------------------------------------------------------------
  5. |   IBFORUMS v1
  6. |   ========================================
  7. |   by Matthew Mecham and David Baxter
  8. |   (c) 2001,2002 IBForums
  9. |   http://www.ibforums.com
  10. |   ========================================
  11. |   Web: http://www.ibforums.com
  12. |   Email: phpboards@ibforums.com
  13. |   Licence Info: phpib-licence@ibforums.com
  14. +---------------------------------------------------------------------------
  15. |
  16. |   > Registration functions
  17. |   > Module written by Matt Mecham
  18. |   > Date started: 16th February 2002
  19. |
  20. |    > Module Version Number: 1.0.0
  21. +--------------------------------------------------------------------------
  22. */
  23.  
  24.  
  25. $idx = new Register;
  26.  
  27. class Register {
  28.  
  29.     var $output     = "";
  30.     var $page_title = "";
  31.     var $nav        = array();
  32.     var $html       = "";
  33.     var $email      = "";
  34.     
  35.     function Register() {
  36.         global $ibforums, $DB, $std, $print;
  37.         
  38.         //--------------------------------------------
  39.         // Make sure our code number is numerical only
  40.         //--------------------------------------------
  41.         
  42.         //$ibforums->input['CODE'] = preg_replace("/^([0-9]+)$/", "$1", $ibforums->input['CODE']);
  43.         
  44.         if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = 00;
  45.         
  46.         //--------------------------------------------
  47.         // Require the HTML and language modules
  48.         //--------------------------------------------
  49.         
  50.         $ibforums->lang = $std->load_words($ibforums->lang, 'lang_register', $ibforums->lang_id );
  51.         
  52.         require "./Skin/".$ibforums->skin_id."/skin_register.php";
  53.         $this->html = new skin_register();
  54.         
  55.         $this->base_url        = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
  56.         $this->base_url_nosess = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}";
  57.         
  58.         //--------------------------------------------
  59.         // Get the emailer module
  60.         //--------------------------------------------
  61.         
  62.         require "./sources/lib/emailer.php";
  63.         
  64.         $this->email = new emailer();
  65.         
  66.         //--------------------------------------------
  67.         // What to do?
  68.         //--------------------------------------------
  69.         
  70.         switch($ibforums->input['CODE']) {
  71.             case '00':
  72.                 $this->show_reg_form();
  73.                 break;
  74.                 
  75.             case '02':
  76.                 $this->create_account();
  77.                 break;
  78.                 
  79.             case '03':
  80.                 $this->validate_user();
  81.                 break;
  82.  
  83.             case '05':
  84.                 $this->show_manual_form();
  85.                 break;
  86.                 
  87.             case '06':
  88.                 $this->show_manual_form('lostpass');
  89.                 break;
  90.                 
  91.             case '07':
  92.                 $this->show_manual_form('newemail');
  93.                 break;
  94.                 
  95.             case '10':
  96.                 $this->lost_password_start();
  97.                 break;
  98.             case '11':
  99.                 $this->lost_password_end();
  100.                 break;
  101.  
  102.             default:
  103.                 $this->show_reg_form();
  104.                 break;
  105.         }
  106.         
  107.         // If we have any HTML to print, do so...
  108.         
  109.         $print->add_output("$this->output");
  110.         $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
  111.             
  112.      }
  113.      
  114.      /*****************************************************/
  115.     // lost_password_start
  116.     // ------------------
  117.     // Simply shows the lostpassword form
  118.     // What do you want? Blood?
  119.     /*****************************************************/
  120.     
  121.     function lost_password_start()
  122.     {
  123.         global $ibforums, $DB, $std;
  124.         
  125.         $this->page_title = $ibforums->lang['lost_pass_form'];
  126.         
  127.         $this->nav        = array( $ibforums->lang['lost_pass_form'] );
  128.  
  129.         $this->output    .= $this->html->lost_pass_form();
  130.     }
  131.     
  132.     
  133.     
  134.     
  135.     function lost_password_end()
  136.     {
  137.         global $ibforums, $DB, $std, $HTTP_POST_VARS, $print;
  138.         
  139.         if ($HTTP_POST_VARS['member_name'] == "")
  140.         {
  141.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) );
  142.         }
  143.         
  144.         //------------------------------------------------------------
  145.         // Check for input and it's in a valid format.
  146.         //------------------------------------------------------------
  147.         
  148.         $member_name = trim(strtolower($ibforums->input['member_name']));
  149.         
  150.         if ($member_name == "")
  151.         {
  152.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) );
  153.         }
  154.         
  155.         //------------------------------------------------------------
  156.         // Attempt to get the user details from the DB
  157.         //------------------------------------------------------------
  158.         
  159.         $DB->query("SELECT name, id, email, mgroup, validate_key FROM ibf_members WHERE LOWER(name)='$member_name'");
  160.         
  161.         if ( !$DB->get_num_rows() )
  162.         {
  163.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
  164.         }
  165.         else
  166.         {
  167.             $member = $DB->fetch_row();
  168.             
  169.             //------------------------------------------------------------
  170.             // Is there a validation key? If so, we'd better not touch it
  171.             //------------------------------------------------------------
  172.             
  173.             if ($member['mgroup'] == $ibforums->vars['auth_group'])
  174.             {
  175.                 $std->Error( array( 'LEVEL' => 1, 'MSG' => 'val_key_present' ) );
  176.             }
  177.             
  178.             if ($member['id'] == "")
  179.             {
  180.                 $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
  181.             }
  182.             
  183.             $new_pass     = $std->make_password();
  184.             $validate_key = $std->make_password();
  185.             $md5_pass     = md5($new_pass);
  186.             
  187.             //------------------------------------------------------------
  188.             // Update the DB for this member.
  189.             //------------------------------------------------------------
  190.             
  191.             $DB->query("UPDATE ibf_members SET new_pass='$md5_pass', validate_key='$validate_key' WHERE id='".$member['id']."'");
  192.             
  193.             //------------------------------------------------------------
  194.             // Send out the email.
  195.             //------------------------------------------------------------
  196.             
  197.             $this->email->get_template("lost_pass");
  198.                 
  199.             $this->email->build_message( array(
  200.                                                 'NAME'         => $member['name'],
  201.                                                 'PASSWORD'     => $new_pass,
  202.                                                 'MAN_LINK'     => $this->base_url_nosess."?act=Reg&CODE=06",
  203.                                                 'EMAIL'        => $member['email'],
  204.                                                 'ID'           => $member['id'],
  205.                                                 'CODE'         => $validate_key,
  206.                                               )
  207.                                         );
  208.                                         
  209.             $this->email->subject = $ibforums->lang['lp_subject'].' '.$ibforums->vars['BOARDNAME'];
  210.             $this->email->to      = $member['email'];
  211.             
  212.             $this->email->send_mail();
  213.             
  214.             $std->my_setcookie( 'pass_hash' , '-1', 0 );
  215.             
  216.             $print->redirect_screen( $ibforums->lang['lp_redirect'], 'act=Reg&CODE=06' );
  217.         }
  218.         
  219.     }
  220.      
  221.      /*****************************************************/
  222.     // show_reg_form
  223.     // ------------------
  224.     // Simply shows the registration form, no - really! Thats
  225.     // all it does. It doesn't make the tea or anything.
  226.     // Just the registration form, no more - no less.
  227.     // Unless your server went down, then it's just useless.
  228.     /*****************************************************/   
  229.     
  230.     function show_reg_form() {
  231.         global $ibforums, $DB, $std;
  232.         
  233.         if ($ibforums->vars['no_reg'] == 1)
  234.         {
  235.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'reg_off' ) );
  236.         }
  237.         
  238.         if ($ibforums->vars['reg_auth_type'])
  239.         {
  240.             $ibforums->lang['std_text'] .= "<br>" . $ibforums->lang['email_validate_text'];
  241.         }
  242.         
  243.         $this->page_title = $ibforums->lang['registration_form'];
  244.         $this->nav        = array( $ibforums->lang['registration_form'] );
  245.  
  246.         $this->output    .= $this->html->ShowForm( array( 'TEXT' => $ibforums->lang['std_text'], 'RULES' => $ibforums->lang['click_wrap'] ) );
  247.     
  248.     }
  249.     
  250.        /*****************************************************/
  251.     // create_account
  252.     // ------------------
  253.     // Now this is a really good subroutine. It adds the member
  254.     // to the members table in the database. Yes, really fancy
  255.     // this one. It also finds the time to see if we need to
  256.     // check any email verification type malarky before we
  257.     // can use this brand new account. It's like buying a new
  258.     // car and getting it towed home and being told the keys
  259.     // will be posted later. Although you can't polish this
  260.     // routine while you're waiting.
  261.     /*****************************************************/ 
  262.     
  263.     function create_account() {
  264.         global $ibforums, $std, $DB, $print;
  265.         
  266.         if ($ibforums->vars['no_reg'] == 1)
  267.         {
  268.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'reg_off' ) );
  269.         }
  270.         
  271.         // Trim off the username and password
  272.         
  273.         $in_username = trim($ibforums->input['UserName']);
  274.         $in_password = trim($ibforums->input['PassWord']);
  275.         $in_email    = strtolower( trim($ibforums->input['EmailAddress']) );
  276.         
  277.         $ibforums->input['EmailAddress_two'] = strtolower( trim($ibforums->input['EmailAddress_two']) );
  278.         
  279.         if ($ibforums->input['EmailAddress_two'] != $in_email)
  280.         {
  281.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'email_addy_mismatch' ) );
  282.         }
  283.         
  284.         //+--------------------------------------------
  285.         //| Check for errors in the input.
  286.         //+--------------------------------------------
  287.         
  288.         if (empty($in_username))                         $std->Error( array( LEVEL => 1, MSG => 'no_username' ) );
  289.         if (strlen($in_username) < 3)                    $std->Error( array( LEVEL => 1, MSG => 'username_short' ) );
  290.         if (strlen($in_username) > 32)                   $std->Error( array( LEVEL => 1, MSG => 'username_long' ) );
  291.         
  292.         if (empty($in_password))                         $std->Error( array( LEVEL => 1, MSG => 'pass_blank' ) );
  293.         if (strlen($in_password) < 3)                    $std->Error( array( LEVEL => 1, MSG => 'pass_too_short' ) );
  294.         if (strlen($in_password) > 32)                   $std->Error( array( LEVEL => 1, MSG => 'pass_too_long' ) );
  295.         if ($ibforums->input['PassWord_Check'] != $in_password) $std->Error( array( LEVEL => 1, MSG => 'pass_no_match' ) );
  296.         
  297.         if (strlen($in_email) < 6)                       $std->Error( array( LEVEL => 1, MSG => 'invalid_email' ) );
  298.         
  299.         //+--------------------------------------------
  300.         //| Check the email address
  301.         //+--------------------------------------------
  302.         
  303.         $in_email = $std->clean_email($in_email);
  304.         
  305.         if (! $in_email )
  306.         {
  307.             $std->Error( array( LEVEL => 1, MSG => 'invalid_email' ) );
  308.         }
  309.         
  310.         //+--------------------------------------------
  311.         //| Is this name already taken?
  312.         //+--------------------------------------------
  313.         
  314.         $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".strtolower($in_username)."'");
  315.         $name_check = $DB->fetch_row();
  316.         
  317.         if ($name_check['id'])
  318.         {
  319.             $std->Error( array( LEVEL => 1, MSG => 'user_exists' ) );
  320.         }
  321.         
  322.         if (strtolower($in_username) == 'guest')
  323.         {
  324.             $std->Error( array( LEVEL => 1, MSG => 'user_exists' ) );
  325.         }
  326.         
  327.         //+--------------------------------------------
  328.         //| Is this email addy taken?
  329.         //+--------------------------------------------
  330.         
  331.         if (! $ibforums->vars['allow_dup_email'] )
  332.         {
  333.             $DB->query("SELECT id FROM ibf_members WHERE email='".$in_email."'");
  334.             $email_check = $DB->fetch_row();
  335.             if ($email_check['id'])
  336.             {
  337.                 $std->Error( array( LEVEL => 1, MSG => 'email_exists' ) );
  338.             }
  339.         }
  340.         
  341.         //+--------------------------------------------
  342.         //| Are they in the reserved names list?
  343.         //+--------------------------------------------
  344.         
  345.         if ($ibforums->vars['ban_names'])
  346.         {
  347.             $names = explode( "|" , $ibforums->vars['ban_names'] );
  348.             foreach ($names as $n)
  349.             {
  350.                 if (preg_match( "/$n/i", $in_username ))
  351.                 {
  352.                     $std->Error( array( LEVEL => 1, MSG => 'user_exists' ) );
  353.                     break;
  354.                 }
  355.             }
  356.         }    
  357.         
  358.         //+--------------------------------------------
  359.         //| Are they banned?
  360.         //+--------------------------------------------
  361.         
  362.         if ($ibforums->vars['ban_ip'])
  363.         {
  364.             $ips = explode( "|", $ibforums->vars['ban_ip'] );
  365.             foreach ($ips as $ip)
  366.             {
  367.                 $ip = preg_replace( "/\*/", '.*' , $ip );
  368.                 if (preg_match( "/$ip/", $ibforums->input['IP_ADDRESS'] ))
  369.                 {
  370.                     $std->Error( array( LEVEL => 1, MSG => 'you_are_banned' ) );
  371.                 }
  372.             }
  373.         }
  374.         
  375.         if ($ibforums->vars['ban_email'])
  376.         {
  377.             $ips = explode( "|", $ibforums->vars['ban_email'] );
  378.             foreach ($ips as $ip)
  379.             {
  380.                 $ip = preg_replace( "/\*/", '.*' , $ip );
  381.                 if (preg_match( "/$ip/", $in_email ))
  382.                 {
  383.                     $std->Error( array( LEVEL => 1, MSG => 'you_are_banned' ) );
  384.                 }
  385.             }
  386.         }
  387.         
  388.         
  389.         //+--------------------------------------------
  390.         //| Build up the hashes
  391.         //+--------------------------------------------
  392.         
  393.         $mem_group = $ibforums->vars['member_group'];
  394.         
  395.         //+--------------------------------------------
  396.         //| Are we asking the member or admin to preview?
  397.         //+--------------------------------------------
  398.         
  399.         if ($ibforums->vars['reg_auth_type'])
  400.         {
  401.             $mem_group = $ibforums->vars['auth_group'];
  402.         }
  403.         
  404.         //+--------------------------------------------
  405.         //| Find the highest member id, and increment it
  406.         //| auto_increment not used for guest id 0 val.
  407.         //+--------------------------------------------
  408.         
  409.         $DB->query("SELECT MAX(id) as new_id FROM ibf_members");
  410.         $r = $DB->fetch_row();
  411.         
  412.         $member_id = $r['new_id'] + 1;
  413.         
  414.         $member = array(
  415.                          'id'              => $member_id,
  416.                          'name'            => $in_username,
  417.                          'password'        => $in_password,
  418.                          'email'           => $in_email,
  419.                          'mgroup'          => $mem_group,
  420.                          'posts'           => 0,
  421.                          'avatar'          => 'noavatar',
  422.                          'joined'          => time(),
  423.                          'ip_address'      => $ibforums->input['IP_ADDRESS'],
  424.                          'time_offset'     => $ibforums->vars['time_offset'],
  425.                          'view_sigs'       => 1,
  426.                          'email_pm'        => 1,
  427.                          'view_img'        => 1,
  428.                          'view_avs'        => 1,
  429.                          'allow_post'      => 1,
  430.                          'view_pop'        => 1,
  431.                          'vdirs'           => "in:Inbox|sent:Sent Items",
  432.                          'msg_total'       => 0,
  433.                          'new_msg'         => 0,
  434.                        );
  435.                        
  436.         
  437.                        
  438.         //+--------------------------------------------
  439.         //| Insert into the DB
  440.         //+--------------------------------------------
  441.         
  442.         $member['password'] = md5( $member['password'] );
  443.         
  444.         $db_string = $std->compile_db_string( $member );
  445.         
  446.         $DB->query("INSERT INTO ibf_members (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
  447.         
  448.         unset($db_string);
  449.         
  450.         $validate_key = $std->make_password();
  451.         $time         = time();
  452.         
  453.         
  454.         if ( ($ibforums->vars['reg_auth_type'] == 'user') or ($ibforums->vars['reg_auth_type'] == 'admin') ) {
  455.         
  456.             // We want to validate all reg's via email, after email verificiation has taken place,
  457.             // we restore their previous group and remove the validate_key
  458.             
  459.             $DB->query("UPDATE ibf_members SET validate_key='$validate_key', prev_group='".$ibforums->vars['member_group']."' "
  460.                       ."WHERE id='$member_id'");
  461.             
  462.             
  463.             if ( $ibforums->vars['reg_auth_type'] == 'user' )
  464.             {
  465.             
  466.                 $this->email->get_template("reg_validate");
  467.                 
  468.                 $this->email->build_message( array(
  469.                                                     'THE_LINK'     => $this->base_url_nosess."?act=Reg&CODE=03&uid=".urlencode($member_id)."&aid=".urlencode($validate_key),
  470.                                                     'NAME'         => $member['name'],
  471.                                                     'PASSWORD'     => $in_password,
  472.                                                     'MAN_LINK'     => $this->base_url_nosess."?act=Reg&CODE=05",
  473.                                                     'EMAIL'        => $member['email'],
  474.                                                     'ID'           => $member_id,
  475.                                                     'CODE'         => $validate_key,
  476.                                                   )
  477.                                             );
  478.                                             
  479.                 $this->email->subject = "Registration at ".$ibforums->vars['board_name'];
  480.                 $this->email->to      = $member['email'];
  481.                 
  482.                 $this->email->send_mail();
  483.                 
  484.                 $this->output     = $this->html->show_authorise( $member );
  485.                 
  486.             }
  487.             else if ( $ibforums->vars['reg_auth_type'] == 'admin' )
  488.             {
  489.                 $this->output     = $this->html->show_preview( $member );
  490.             }
  491.             
  492.             $this->page_title = $ibforums->lang['reg_success'];
  493.             
  494.             $this->nav        = array( $ibforums->lang['nav_reg'] );
  495.         }
  496.  
  497.         else
  498.         {
  499.             
  500.             // We don't want to preview, or get them to validate via email.
  501.             
  502.             $DB->query("UPDATE ibf_stats SET ".
  503.                          "MEM_COUNT=MEM_COUNT+1, ".
  504.                          "LAST_MEM_NAME='" . $member['name'] . "', ".
  505.                          "LAST_MEM_ID='"   . $member['id']   . "'");
  506.                          
  507.             if ($ibforums->vars['new_reg_notify']) {
  508.                 
  509.                 $date = $std->get_date( time(), 'LONG' );
  510.                 
  511.                 $this->email->get_template("admin_newuser");
  512.             
  513.                 $this->email->build_message( array(
  514.                                                     'DATE'         => $date,
  515.                                                     'MEMBER_NAME'  => $member['name'],
  516.                                                   )
  517.                                             );
  518.                                             
  519.                 $this->email->subject = "New Registration at ".$ibforums->vars['board_name'];
  520.                 $this->email->to      = $ibforums->vars['email_in'];
  521.                 $this->email->send_mail();
  522.             }
  523.                 
  524.             $text = $ibforums->lang['done_reg_2'];
  525.             $url  = 'act=Login&CODE=00';
  526.             
  527.             
  528.             $print->redirect_screen( $text, $url );
  529.         }
  530.                 
  531.     } 
  532.     
  533.     /*****************************************************/
  534.     // validate_user
  535.     // ------------------
  536.     // Leave a message after the tone, and I'll amuse myself
  537.     // by pulling faces when hearing the message later.
  538.     /*****************************************************/
  539.     
  540.     function validate_user() {
  541.         global $ibforums, $std, $DB, $print;
  542.         
  543.         //------------------------------------------------------------
  544.         // Check for input and it's in a valid format.
  545.         //------------------------------------------------------------
  546.         
  547.         $in_user_id      = trim(urldecode($ibforums->input['uid']));
  548.         $in_validate_key = trim(urldecode($ibforums->input['aid']));
  549.         $in_type         = trim($ibforums->input['type']);
  550.         
  551.         if ($in_type == "")
  552.         {
  553.             $in_type = 'reg';
  554.         }
  555.         
  556.         //------------------------------------------------------------
  557.         
  558.         if (! preg_match( "/^(?:[\d\w]){6,14}$/", $in_validate_key ) )
  559.         {
  560.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) );
  561.         }
  562.         
  563.         //------------------------------------------------------------
  564.         
  565.         if (! preg_match( "/^(?:\d){1,}$/", $in_user_id ) )
  566.         {
  567.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) );
  568.         }
  569.         
  570.         //------------------------------------------------------------
  571.         // Attempt to get the profile of the requesting user
  572.         //------------------------------------------------------------
  573.         
  574.         $DB->query("SELECT id, name, validate_key, prev_group, mgroup, email, new_pass FROM ibf_members WHERE id='$in_user_id'");
  575.         
  576.         if ( !$DB->get_num_rows() )
  577.         {
  578.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_mem' ) );
  579.         }
  580.         
  581.         //------------------------------------------------------------
  582.         
  583.         $member = $DB->fetch_row();
  584.         
  585.         //------------------------------------------------------------
  586.         
  587.         if ( $member['id'] == "" )
  588.         {
  589.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_mem' ) );
  590.         }
  591.         
  592.         //------------------------------------------------------------
  593.         if ( $member['validate_key'] == "")
  594.         {
  595.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_key' ) );
  596.         }
  597.         else if ($member['validate_key'] != $in_validate_key)
  598.         {
  599.             $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_key_wrong' ) );
  600.         }
  601.         else
  602.         {
  603.             //------------------------------------------------------------
  604.             // Update the member...
  605.             //------------------------------------------------------------
  606.             
  607.             if ($in_type == 'reg')
  608.             {
  609.             
  610.                 if (empty($member['prev_group']))
  611.                 {
  612.                     $member['prev_group'] = $ibforums->vars['member_group'];
  613.                 }
  614.                 
  615.                 $DB->query("UPDATE ibf_members SET mgroup='".$member['prev_group']."', prev_group='', validate_key='', new_pass='' WHERE id='".$member['id']."'");
  616.             
  617.                 //------------------------------------------------------------
  618.                 // Update the stats...
  619.                 //------------------------------------------------------------
  620.             
  621.                 $DB->query("UPDATE ibf_stats SET ".
  622.                              "MEM_COUNT=MEM_COUNT+1, ".
  623.                              "LAST_MEM_NAME='" . $member['name'] . "', ".
  624.                              "LAST_MEM_ID='"   . $member['id']   . "'");
  625.                              
  626.                 if ($ibforums->vars['new_reg_notify']) {
  627.                     
  628.                     $date = $std->get_date( time(), 'LONG' );
  629.                     
  630.                     $this->email->get_template("admin_newuser");
  631.                 
  632.                     $this->email->build_message( array(
  633.                                                         'DATE'         => $date,
  634.                                                         'MEMBER_NAME'  => $member['name'],
  635.                                                       )
  636.                                                 );
  637.                                                 
  638.                     $this->email->subject = "New Registration at ".$ibforums->vars['board_name'];
  639.                     $this->email->to      = $ibforums->vars['email_in'];
  640.                     $this->email->send_mail();
  641.                 }
  642.             
  643.             }
  644.             else if ($in_type == 'lostpass')
  645.             {
  646.             
  647.                 if ($member['new_pass'] == "")
  648.                 {
  649.                     $std->Error( array( 'LEVEL' => 1, 'MSG' => 'lp_no_pass' ) );
  650.                 }
  651.                 
  652.                 $DB->query("UPDATE ibf_members SET password='".$member['new_pass']."', prev_group='', validate_key='', new_pass='' WHERE id='".$member['id']."'");
  653.             
  654.             }
  655.             else if ($in_type == 'newemail')
  656.             {
  657.                 if (empty($member['prev_group']))
  658.                 {
  659.                     $member['prev_group'] = $ibforums->vars['member_group'];
  660.                 }
  661.                 
  662.                 $DB->query("UPDATE ibf_members SET mgroup='".$member['prev_group']."', prev_group='', validate_key='', new_pass='' WHERE id='".$member['id']."'");
  663.             }
  664.                 
  665.             $text = $ibforums->lang['done_reg_2'];
  666.             $url  = 'act=Login&CODE=00';
  667.             
  668.             
  669.             $print->redirect_screen( $text, $url );
  670.         } 
  671.         
  672.     } 
  673.     
  674.     /*****************************************************/
  675.     // show_board_rules
  676.     // ------------------
  677.     // o_O  ^^
  678.     /*****************************************************/
  679.     
  680.     function show_board_rules() {
  681.         global $ibforums, $DB;
  682.         
  683.         $DB->query("SELECT RULES_TEXT from ib_forum_rules WHERE ID='00'");
  684.         $rules = $DB->fetch_row();
  685.         
  686.         $this->output     = $this->html->show_rules($rules);
  687.         $this->page_title = $ibforums->lang['board_rules'];
  688.         $this->nav        = array( $ibforums->lang['board_rules'] );
  689.     
  690.     }
  691.     
  692.     /*****************************************************/
  693.     // show_manual_form
  694.     // ------------------
  695.     // This feature is not available in an auto option
  696.     /*****************************************************/
  697.     
  698.     function show_manual_form($type='reg') {
  699.         global $ibforums;
  700.         
  701.         $this->output     = $this->html->show_dumb_form($type);
  702.         $this->page_title = $ibforums->lang['activation_form'];
  703.         $this->nav        = array( $ibforums->lang['activation_form'] );
  704.     
  705.     }
  706.     
  707.         
  708. }
  709.  
  710. ?>
  711.